package org.example.leetcode;

import java.util.Stack;

/**
 * @version 1.0.0
 * @author: lynn
 * @description:判断是否是回文串
 * @date: 2021/7/24 11:34
 */
public class LC9 {

    public static void main(String[] args) {
        LC9 lc=new LC9();
        System.out.println(Boolean.toString(lc.isPalindrome(-121)));
    }

    //fixme 数字的翻转，回文数字，回文字符不好弄
    public boolean isPalindrome(int x) {
        if(x<0) return false;
        int out=0;
        int originX=x;
        while (x!=0){
            int digit=x%10;
            x=x/10;
            out=out*10+digit;
        }
        return originX==out;
    }


}
